<%@ page contentType="text/html;charset=UTF-8" isErrorPage="true" %>
<%@ page import="org.slf4j.Logger,org.slf4j.LoggerFactory" %>
<%@ page import="com.augurit.common.base.action.BaseAction" %>
<%@ page import="com.augurit.common.system.web.auth.form.LoginUserForm" %>
<%@ page import="com.augurit.common.system.util.WebContextUtils" %>
<%@ page import="com.augurit.common.syslog.tool.SysTraceLogWriter;"%>

<%
	Throwable ex = null;

	if (exception != null)
		ex = exception;
	if (request.getAttribute("javax.servlet.error.exception") != null)
		ex = (Throwable) request.getAttribute("javax.servlet.error.exception");

	//记录日志至数据库
	LoginUserForm loginUser = (LoginUserForm)request.getSession().getAttribute(WebContextUtils.SES_LOGIN_USER);
	Logger logger = LoggerFactory.getLogger(BaseAction.DB_LOGGER_NAME);
	logger.error(loginUser.getUser().getUserName() + SysTraceLogWriter.MESSAGE_SEPARATOR + ex.getMessage(), ex);
	
	ex.printStackTrace();
	
	//显示错误页面
	response.sendRedirect(request.getContextPath() + "/common/error.jsp");
%>